Use date instead of travis/appveyor build number in pre-release names. (#180)
authortsteven4 <tsteven4@users.noreply.github.com>
Tue, 22 May 2018 15:13:05 +0000 (09:13 -0600)
committerGitHub <noreply@github.com>
Tue, 22 May 2018 15:13:05 +0000 (09:13 -0600)
appveyor.yml
tools/travis_script_osx

index 7f8323883a8fe73825c82adaee902811a3ae36c3..7f8beded7e86330c8755b9bec137f8b75a356c7d 100644 (file)
@@ -49,17 +49,19 @@ build_script:
         # by using the next version of windeployqt which had this
         # bug fixed.
         & ".\tools\make_windows_release.ps1" -windeployqt "C:\Qt\5.6\mingw49_32\bin\windeployqt.exe"
-        $sha=(git rev-parse --short=7 HEAD)
-        Get-ChildItem .\gui\release\GPSBabel-*-Setup.exe | % { Push-AppveyorArtifact $_.FullName -FileName "GPSBabelTest-$($env:APPVEYOR_BUILD_VERSION)-$($sha)-Setup.exe" }
-        Get-ChildItem .\gui\release\GPSBabel-*-Manifest.txt | % { Push-AppveyorArtifact $_.FullName -FileName "GPSBabelTest-$($env:APPVEYOR_BUILD_VERSION)-$($sha)-Manifest.txt" }
+        $verid=(Get-Date -UFormat "%Y%m%dT%H%MZ" -Date (Get-Date -Date (git show -s --format="%aI" HEAD)).toUniversalTime()) `
+               + '-' + (git rev-parse --short=7 HEAD)
+        Get-ChildItem .\gui\release\GPSBabel-*-Setup.exe | % { Push-AppveyorArtifact $_.FullName -FileName "GPSBabel-$($verid)-Setup.exe" }
+        Get-ChildItem .\gui\release\GPSBabel-*-Manifest.txt | % { Push-AppveyorArtifact $_.FullName -FileName "GPSBabel-$($verid)-Manifest.txt" }
       }
       elseif (($env:platform -eq "x86") -and ($env:qt -eq "5.9\msvc2015"))
       {
         # full build and deploy of our release configuration
         & ".\tools\make_windows_release.ps1" -gpsbabel_build_dir_name "build-GPSBabel-Desktop_Qt_5_9_MSVC2015_32bit-Release" -gui_build_dir_name "build-app-Desktop_Qt_5_9_MSVC2015_32bit-Release" -mkspec win32-msvc -mkcmd nmake.exe
-        $sha=(git rev-parse --short=7 HEAD)
-        Get-ChildItem .\gui\release\GPSBabel-*-Setup.exe | % { Push-AppveyorArtifact $_.FullName -FileName "GPSBabelTest-$($env:APPVEYOR_BUILD_VERSION)-$($sha)-Setup.exe" }
-        Get-ChildItem .\gui\release\GPSBabel-*-Manifest.txt | % { Push-AppveyorArtifact $_.FullName -FileName "GPSBabelTest-$($env:APPVEYOR_BUILD_VERSION)-$($sha)-Manifest.txt" }
+        $verid=(Get-Date -UFormat "%Y%m%dT%H%MZ" -Date (Get-Date -Date (git show -s --format="%aI" HEAD)).toUniversalTime()) `
+               + '-' + (git rev-parse --short=7 HEAD)
+        Get-ChildItem .\gui\release\GPSBabel-*-Setup.exe | % { Push-AppveyorArtifact $_.FullName -FileName "GPSBabel-$($verid)-Setup.exe" }
+        Get-ChildItem .\gui\release\GPSBabel-*-Manifest.txt | % { Push-AppveyorArtifact $_.FullName -FileName "GPSBabel-$($verid)-Manifest.txt" }
       }
       elseif ($env:platform -eq "mingw")
       {
@@ -95,10 +97,11 @@ deploy_script:
       if (($env:platform -eq "x86") -and ($env:qt -eq "5.9\msvc2015") -and ($env:APPVEYOR_REPO_BRANCH -eq "master"))
       {
         $env:projdir=(C:\msys64\usr\bin\bash.exe -c "pwd")
-        $env:sha=(C:\msys64\usr\bin\bash.exe -c "git rev-parse --short=7 HEAD")
+        $verid=(Get-Date -UFormat "%Y%m%dT%H%MZ" -Date (Get-Date -Date (git show -s --format="%aI" HEAD)).toUniversalTime()) `
+               + '-' + (git rev-parse --short=7 HEAD)
         C:\msys64\usr\bin\bash.exe -lc "cd $env:projdir; ls ./gui/release/*.exe"
-        C:\msys64\usr\bin\bash.exe -lc "cd $env:projdir; cp -p ./gui/release/GPSBabel-*-Setup.exe GPSBabelTest-$($env:APPVEYOR_BUILD_VERSION)-$($sha)-Setup.exe"
-        C:\msys64\usr\bin\bash.exe -lc "cd $env:projdir; ./tools/uploadtool/upload_appveyor.sh GPSBabelTest-$($env:APPVEYOR_BUILD_VERSION)-$($sha)-Setup.exe"
+        C:\msys64\usr\bin\bash.exe -lc "cd $env:projdir; cp -p ./gui/release/GPSBabel-*-Setup.exe GPSBabel-$($verid)-Setup.exe"
+        C:\msys64\usr\bin\bash.exe -lc "cd $env:projdir; ./tools/uploadtool/upload_appveyor.sh GPSBabel-$($verid)-Setup.exe"
         Write-Host "Finished deploy_script"
       }
 
index 946d0c67e92bd26df6fccecf93440e6696220563..1272928c5cebaf8c6b18e987d57b733343f080cf 100755 (executable)
@@ -7,13 +7,8 @@ QMAKE=${QMAKE:-qmake}
 LUPDATE=${LUPDATE:-lupdate}
 LRELEASE=${LRELEASE:-lrelease}
 MACDEPLOYQT=${MACDEPLOYQT:-macdeployqt}
-if [ -z ${VERSIONID+x} ]; then
-  if [ -z "$TRAVIS_BUILD_NUMBER" ]; then
-    VERSIONID=$(git rev-parse --short=7 HEAD)
-  else
-    VERSIONID=${TRAVIS_BUILD_NUMBER}-$(git rev-parse --short=7 HEAD)
-  fi
-fi
+# we assume we are on macOS, so date is not gnu date.
+VERSIONID=${VERSIONID:-$(date -ju -f %Y-%m-%dT%H:%M:%S%z $(git show -s --format="%aI" HEAD | sed 's/:\(..\)$/\1/') +%Y%m%dT%H%MZ)-$(git rev-parse --short=7 HEAD)}
 
 # build and test the CLI
 $QMAKE GPSBabel.pro && make && make check